import pygame
class Music():
    """音乐播放的控制类"""
    def __init__(self, musicpath):
        self.music_path = musicpath

    def playBackMusic(self):
        """播放音乐"""
        pygame.mixer.init()
        pygame.mixer.music.load(self.music_path)
        pygame.mixer.music.play()

    def stopBackMusic(self):
        """停止播放当前的音乐"""
        pygame.mixer.music.stop()

    def playBulletMusic(self):
        bullerMusic = pygame.mixer.Sound(self.music_path)
        bullerMusic.play(1)